import { connect } from "../react-redux";

function Hello({ count, add }) {
  console.log("Hello Render");

  return (
    <div>
      <h4>Hello</h4>

      <button onClick={add}>COUNT: {count}</button>
    </div>
  );
}

// eslint-disable-next-line react-refresh/only-export-components
export default connect(
  (state) => ({
    count: state.count,
  }),
  {
    add: () => {
      console.log("add");
      // 返回一个动作
      return { type: "INCREMENT" };
    },
  }
)(Hello);
